package com.zzxy.spring5.test;

import com.zzxy.spring5.factory.UserServiceStatciFactory;
import com.zzxy.spring5.service.IUserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ClassPathXmlApplication {
    public ClassPathXmlApplication(Object s) {

    }

    public Object getBean(Object name) {
        return name;
    }

    public class Test {
        public static <UserServiceImpl> void main(String[] arg) throws InterruptedException {
        /*UserServicelmpl userService = new UserServicelmpl();
        System.out.println(userService);
        userService.setUsername("Zhangsan");
        UserServicelmpl userService1 = new UserServicelmpl();
        System.out.println(userService1);*/
            String s = "beans .xml";
        /*ClassPathXmlApplicationContext context = new classPathXmlApplicationContext(confglocaton:"beans .xml");
        UserServiceImpl userService = (UserServiceImpl) context.getBean( name: "userService");
        System.out.println(uerService);*/
            //  userService.addUser()'
            ClassPathXmlApplication context1 = new ClassPathXmlApplication("beans.xml");
            UserServiceImpl userService1 = (UserServiceImpl) context1.getBean("userService");
            //   System.out.println(userService1);
            userService1.wait();

            //           var userService = UserServiceStatciFactory.createUserService();
        }
    }
}
